package com.gjy.vm;

import java.util.ArrayList;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-05-31 16:43:40
 */
public class OOMTest {

    public static void main(String[] args) {

        // -Xmx1m -Xms1m -Xss128k -verbose:gc -XX:+PrintGCDetails -XX:SurvivorRatio=8 -XX:+HeapDumpOnOutOfMemoryError
        // -XX:PermSize=10m -XX:MaxPermSize=10m
        for (int i = 0; i < 100000; i++) {
            ArrayList<Object> objects = new ArrayList<>();
            objects.add(i);
            System.out.println(objects);
        }

    }
}
